local key1 = "chat:chat_content:ID_" .. KEYS[1] .. ":" .. KEYS[2]
local key2 = "chat:chat_content:ID_" .. KEYS[2] .. ":" .. KEYS[1]
local key3 = "chat:chat_object:ID_" .. KEYS[1] .. ":" .. KEYS[2]
local key4 = "chat:chat_object:ID_" .. KEYS[2] .. ":" .. KEYS[1]
local key5 = "chat:caht_list:ID_" .. KEYS[1]
local key6 = "chat:caht_list:ID_" .. KEYS[2]
local timestamp = tonumber(ARGV[2])

redis.call('ZADD', key5, timestamp, KEYS[2])
redis.call('ZADD', key6, timestamp, KEYS[1])

redis.call('ZADD', key1, timestamp,ARGV[1])
redis.call('ZADD', key2, timestamp,ARGV[1])
redis.call('HSET', key3, 'content', ARGV[3])
redis.call('HSET', key3, 'time', ARGV[4])
redis.call('HSET', key3, 'tip', '0')
redis.call('HSET', key4, 'content', ARGV[3])
redis.call('HSET', key4, 'time', ARGV[4])
redis.call('HINCRBY',key4,'tip',1)